/**
 * 页面主体内容
 */
import 'package:flutter_benchu/utils/commonPkg.dart';


Widget getMaterialApp(BuildContext context) {
  return (
    Consumer<AppNotifier>(
      builder: (BuildContext context, value, Widget child) {
        return MaterialApp(
            //主题
            theme: appTheme,
            //默认页面
            home: SplashPage(),
            //当前语言
            locale: value.locale,
            //路由生成器
            onGenerateRoute: appRouter.generator,
            //设置支持本地化语言集合
            supportedLocales: CustomLocalizations.supportedLocales,
            // 国际化主题配置
            localizationsDelegates: [
              GlobalCupertinoLocalizations.delegate,
              GlobalMaterialLocalizations.delegate,
              GlobalWidgetsLocalizations.delegate,
              CustomLocalizations.delegate //设置本地化代理  
            ],
            // 全局页面(处理)         
            builder: (context, child) {  
              //屏蔽系统字体大小
              return MaxScaleTextWidget(
                max: 1.0,
                child: ScrollConfiguration(
                  //去除安卓滚动视图水波纹
                  behavior: NoOverlayBehavior(),
                  child: child,
              ));
            },
        );
      }
    )
  );
}


class NoOverlayBehavior extends ScrollBehavior {
  @override
  Widget buildViewportChrome(
      BuildContext context, Widget child, AxisDirection axisDirection) {
    return child;
  }
}
